package com.woniuxy.dao;

import com.woniuxy.vo.FoodCommentlVO;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * @author Hgx
 * @ClassName CommentRepo
 * @create 2020-06-09 20:46
 */
public interface CommentRepo extends ElasticsearchRepository<FoodCommentlVO,Integer> {
    @Query("{\"bool\":{\"should\":[{\"match\":{\"foodName\":\"?0\"}},{\"match\":{\"describe\":\"?1\"}},{\"match\":{\"comment\":\"?2\"}}]}}")
    List<FoodCommentlVO> selectFoodCommentByExampleES(String foodName,String describe,String comment);

    @Query("{\"match_all\": {}}")
    List<FoodCommentlVO> selectAllFoodComment();
}
